package com.example.demo.controller;

import com.example.demo.Mappers.GetFeeItemListMapper;
import com.example.demo.beans.GetFeeItemBean;
import com.example.demo.beans.GetFeeItemListRequest;
import com.example.demo.beans.GetFeeItemListResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018-05-28.
 * 查询费用项目
 */
@RestController
public class GetFeeItemListController {
    @Autowired
    private GetFeeItemListMapper mapper;
    @ResponseBody
    @RequestMapping(value = "GetFeeItemList",produces = {"application/xml"})
    public GetFeeItemListResponse getFeeItemList(@RequestBody(required = false)GetFeeItemListRequest request)
    { GetFeeItemListResponse response=new GetFeeItemListResponse();
        if(request!=null){
            response.setResultCode("0");
            response.setResultMsg("交易成功！");
            List<GetFeeItemBean> beans=mapper.getFell();
            int num=beans.size();
            response.setNum(num);
            response.setSqldata(beans);
            return  response;
        }
      response.setResultCode("0");
        response.setResultMsg("请求为空！");
        return  response;
    }
}
